package com.nbsaas.boot.app.rest.convert;

import com.nbsaas.boot.app.data.entity.AppUserRole;
import com.nbsaas.boot.app.api.domain.simple.AppUserRoleSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* 列表对象转换器
*/

public class AppUserRoleSimpleConvert implements Converter<AppUserRoleSimple, AppUserRole> {




@Override
public AppUserRoleSimple convert(AppUserRole source) {
    AppUserRoleSimple result = new AppUserRoleSimple();

                if(source.getApp()!=null){
                    result.setApp(source.getApp().getId());
                }
                if(source.getRole()!=null){
                    result.setRole(source.getRole().getId());
                }
                if(source.getApp()!=null){
                    result.setAppName(source.getApp().getName());
                }
                result.setId(source.getId());
                result.setUser(source.getUser());
                result.setTenant(source.getTenant());


    return result;
}

}